<?php
$judul = '';
$link = '';
$pencarian = array('0'=>'-- pilih jenis properti --','1' => 'Properti untuk investasi', '2' => 'Properti untuk dibeli (tinggal sendiri)', '3' => 'Properti untuk disewa');

$payment = array('1' => 'Cash', '2' => 'Cek');
$titel = array('1' => 'Bapak', '2' => 'Ibu', '3' => 'Sdr/i');
$pendapatan = array('0'=>'-- pilih pendapatan per tahun --','1'=>'30 juta - 60 juta','2'=>'60 juta - 100 juta','3'=>'>100 juta');
$provinsi = array('0'=>'-- pilih lokasi tinggal --','jakarta' => 'DKI Jakarta', 'jateng' => 'Jawa Tengah', 'jabar' => 'Jawa Barat');


function generate_option($array=array(), $sel='') {
    $x = '';
    foreach ($array as $key => $val) {
        if ($key == $sel) {
            $selected = set_select('option', $sel, TRUE);
        } else {
            $selected = set_select('option', $sel);
        }
        echo '<option value="' . $key . '" ' . $selected . '>' . $val . '</option>';
    }
    return $array[$x];
}

function generate_input($span='', $type='', $array=array(), $name='', $sel='') {
    if ($type == 'radio') {
        foreach ($array as $key => $val) {
            echo '<div class="' . $span . '"><label class="radio"><input data-toggle="radio" type="' . $type . '" name="' . $name . '" value="' . $key . '">' . $val . '&nbsp;</label></div>';
        }
    } else {
        foreach ($array as $key => $val) {
            echo '<input type="' . $type . '" name="' . $key . '" value="' . $key . '"/>' . $val . '&nbsp;';
        }
    }
}
?>

    <script type="text/javascript">
        $(function(){
                $('#dp').datepicker();
            });
    </script>

<div class="registration">
      <div class="container">
            <div class="span12 offset2">

                  <form method="post" id="input-form" class="form-horizontal" action="<?php echo site_url('registration/reg_user'); ?>" enctype="multipart/form-data">
                        <div class="indicator"><b>*</b> Indikasi kebutuhan kolom</div>
                        <div class="control-group">
                            <label class="control-label" for="agency_name">Nama Agensi</label>
                            <div class="controls">
                                <select name="agency_name" id="agency_name" class="span3">
                                    <option value="0">Bapak</option>
                                    <option value="1">Ibu</option>
                                    <option value="2">Sdr/i</option>
                                </select>
                            </div> 
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="isDesainer">Apakah Anda desainer?</label>
                            <div class="controls">
                                <select name="isDesainer" id="isDesainer" class="span3">
                                    <option value="0">Ya</option>
                                    <option value="1">Bukan</option>
                                </select>
                            </div> 
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="job_title">Pekerjaan</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" value="<?php echo set_value('job_title'); ?>" name="job_title" id="job_title">
                              </div>
                        </div>

                        <legend>Informasi Pribadi</legend>
                        <div class="control-group">
                            <label class="control-label" for="titel">Titel*</label>
                            <div class="controls">
                                <select name="titel" id="titel" class="span3">
                                    <option value="0">Bapak</option>
                                    <option value="1">Ibu</option>
                                    <option value="2">Sdr/i</option>
                                </select>
                            </div> 
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="nama_depan">Nama Depan*</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="nama_depan" id="nama_depan">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="nama_belakang">Nama Belakang*</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="nama_belakang" id="nama_belakang">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="username">Username*</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="username" id="username">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="birthday">Tanggal Lahir*</label>
                              <div class="controls">
                                <div class="input-append date" id="dp" data-date="<?php echo date("d-m-Y")?>" data-date-format="dd-mm-yyyy">
                                <input class="span2" size="16" type="text" value="<?php echo date("d-m-Y")?>" name="birthday" id="birthday">
                                <span class="add-on"><i class="icon-th"></i></span>
                                </div>
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="name">Alamat E-mail*</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="email" id="email">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="tel">No. HP*</label>
                              <div class="controls">
                                <input type="tel" class="input-xlarge" name="tel" id="tel">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="fax">No. Fax</label>
                              <div class="controls">
                                <input type="tel" class="input-xlarge" name="fax" id="fax">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="pin_bb">Pin Blackberry</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="pin_bb" id="pin_bb">
                              </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label" for="provinsi">Provinsi*</label>
                            <div class="controls">
                                <select name="provinsi" id="provinsi" class="span3">
                                    <option value="0">Jawa Barat</option>
                                    <option value="1">Jawa Tengah</option>
                                    <option value="2">Jawa Timur</option>
                                </select>
                            </div> 
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="kota_area">Kota/Area</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="kota_area" id="kota_area">
                              </div>
                        </div>
                        <p class="palette-paragraph">Silakan masukan kata sandi yang Anda pilih. Harus mengandung setidaknya 8 huruf dan/atau angka.</p>
                        <div class="control-group">
                              <label class="control-label" for="password">Password*</label>
                              <div class="controls">
                                <input type="password" class="input-xlarge" name="password" id="password">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="password_again">Konfirmasi Password*</label>
                              <div class="controls">
                                <input type="password" value="<?php echo set_value('password_confirm'); ?>" class="input-xlarge" name="password_again" id="password_again">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="profil">Profil</label>
                              <div class="controls">
                                <textarea name="profil" rows="3" style="resize:none; width:300px;"></textarea>
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="spesialisasi_area">Spesialisasi Area</label>
                              <div class="controls">
                                <textarea placeholder="Contoh: Jakarta Selatan" name="spesialisasi_area" rows="3" style="resize:none; width:300px;"></textarea>
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="kemampuan_bahasa">Kemampuan Bahasa</label>
                              <div class="controls">
                                <input type="text" class="input-xlarge" name="kemampuan_bahasa" id="kemampuan_bahasa">
                              </div>
                        </div>
                        <div class="control-group">
                              <label class="control-label" for="pengalaman">Deskripsi Keahlian</label>
                              <div class="controls">
                                <textarea name="pengalaman" rows="3" style="resize:none; width:300px;"></textarea>
                              </div>
                        </div>
                        <div class="span9"><hr/></div>
                        
                        <div class="row">
                           <div class="req span3">Metode Pembayaran:</div>
                           <?php echo form_error('payment'); ?>
                           <?php generate_input('span1','radio', $payment, 'payment'); ?>
                           <div class="span2">
                            <label class="radio">
                                <input type="radio" name="payment" id="payment" value="3" data-toggle="radio">
                                Bank Transfer
                            </label>
                           </div>
                        </div>

                        <p>Rumah.com akun Agen Premium anda akan diaktifkan dengan penerimaan pembayaran. <br/>Kami akan email detail username dan kata sandi dengan Rumah.com User Guide</p>
                        <div class="span4 offset2">
                            <input type="submit" name="SUBMIT"  class="btn btn-primary btn-large span3" value="Submit" />
                        </div>
                  </form>
            </div>
      </div>
</div>